<template>
    <div>
      <el-table :data="warehouseInfoList">
        <el-table-column prop="id" label="编号"></el-table-column>
        <el-table-column prop="warName" label="仓库名"></el-table-column>
        <el-table-column prop="warMaxStock" label="仓库最大库存"></el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button size="mini" type="danger" @click="submit(scope.row.id)">配置到该仓库</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
</template>

<script>
    export default {
        name: "designatedWarehouse_T1dialog",
        data(){
          return{
            warehouseInfoList:[],
            t2_Visible:false
          }
        },
        methods:{
          getData(id){
            let shop={
              id:id,//要查询的商品为传来的商品id
              isCheck:1,//必须是审核通过
              isDelete:0//没有被删除
            }
            let params=new URLSearchParams();
            Object.keys(shop).forEach(item=>{
              params.append(item,shop[item]);
            });
            //异步，查询未被删除的商品
            this.$axios.get("warehouseInfo/assignWarehouseInfo.action",{params:shop}).
            then((response)=> {   //异步调用成功执行
              //将查询到的数据存入对象数组中
              this.warehouseInfoList=response.data;
            }).catch(function (error) {//异步调用失败执行
              alert(error);
            });
          },
          submit(id){
            //调用父组件函数
            this.$parent.$parent.config_t2(id);
          },
          handleSizeChange(val) {
            //每页范围
            this.pagesize = val;
            this.getData();
          },
          handleCurrentChange(val) {
            //当前页
            this.pageno = val;
            this.getData();
          }
        }
    }
</script>

<style scoped>

</style>
